package destCity;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class Solution {
    public String destCity(List<List<String>> paths) {
        Set<String>set = new HashSet<>();
        for (int i = 0; i < paths.size(); i++) {
            set.add(paths.get(i).get(1));
        }
        for (int i = 0; i < paths.size(); i++) {
            set.remove(paths.get(i).get(0));
        }
        for (String s: set) {
            return s;
        }
        return null;
    }

}
